//
// [Author] lg (https://github.com/lemos1235)
// [Date] 2025/5/4
//
import 'package:flutter/material.dart';

class NumberStatistic extends StatelessWidget {
  final String title;
  final String value;
  final String? suffix;
  final String? prefix;

  const NumberStatistic({super.key, required this.title, required this.value, this.suffix, this.prefix});
  
  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      mainAxisSize: MainAxisSize.min,
      children: [
        Row(
          crossAxisAlignment: CrossAxisAlignment.baseline,
          textBaseline: TextBaseline.alphabetic,
          children: [
            if (prefix != null)
              Text(
                prefix!,
                style: Theme.of(context).textTheme.bodyMedium,
              ),
            Text(
              value,
              style: Theme.of(context).textTheme.headlineMedium?.copyWith(
                    fontWeight: FontWeight.bold,
                  ),
            ),
            if (suffix != null)
              Text(
                suffix!,
                style: Theme.of(context).textTheme.bodyMedium,
              ),
          ],
        ),
        const SizedBox(height: 4),
        Text(
          title,
          style: TextStyle(
            color: const Color(0xFF999999),
            fontSize: 14,
          ),
        ),
      ],
    );
  }
}

